package com.jeespring.pay.service;

import org.springframework.stereotype.Service;

/**
 * @Title: PayService
 * @Description:
 * @Author 张朝阳
 * @Date 2020/12/1 22:57
 */
@Service
public class PayService {

    public String pay( Long id){
        String result = id + "支付成功！";
        String threadName = Thread.currentThread().getName();
        return threadName + result;
    }

    public String payTimeout( Long id) {
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        String result = id + "支付超时！";
        String threadName = Thread.currentThread().getName();
        return threadName + result;
    }
}
